package sf.database.meta.object;

import sf.database.meta.ColumnMapping;
import sf.tools.StringUtils;

public enum Case {
    UPPER {
        public String getObjectNameToUse(String name) {
            return name.toUpperCase();
        }

        public String getObjectNameToUse(ColumnMapping column) {
            return StringUtils.upperCase(column.getRawColumnName());
        }

        public boolean isCaseSensitive() {
            return false;
        }
    }, LOWER {
        public String getObjectNameToUse(String name) {
            return name.toLowerCase();
        }

        public String getObjectNameToUse(ColumnMapping column) {
            return StringUtils.lowerCase(column.getRawColumnName());
        }

        public boolean isCaseSensitive() {
            return false;
        }
    }, MIXED_SENSITIVE {
        public String getObjectNameToUse(String name) {
            return name;
        }

        public String getObjectNameToUse(ColumnMapping column) {
            return column.getRawColumnName();
        }

        public boolean isCaseSensitive() {
            return true;
        }
    };

    public abstract String getObjectNameToUse(String name);

    public abstract String getObjectNameToUse(ColumnMapping column);

    public abstract boolean isCaseSensitive();
}
